{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "afb2885d",
   "metadata": {},
   "source": [
    "# 元组(tuple)\n",
    "\n",
    "* [元组](https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences)\n",
    "> 1. 它是和list几乎完全一样的序列数据\n",
    "> 2. 它与list不同的地方是，不可变（因为不可变，所以几乎没有方法）\n",
    "> 3. 元组的形式：（1,2,34,5）对比 元组()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d0ce7b30",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('10001', '10002', '10003', '10001') <class 'tuple'>\n"
     ]
    }
   ],
   "source": [
    "stu_id =\"10001\",\"10002\",\"10003\",\"10001\"\n",
    "print(stu_id,type(stu_id))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "7d984657",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_id.count(\"10001\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6a452672",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_id.index(\"10002\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "d7aa8e88",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "99ff9022",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2021, tm_mon=10, tm_mday=25, tm_hour=16, tm_min=36, tm_sec=7, tm_wday=0, tm_yday=298, tm_isdst=0)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5d639d8a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in module time:\n",
      "\n",
      "NAME\n",
      "    time - This module provides various functions to manipulate time values.\n",
      "\n",
      "DESCRIPTION\n",
      "    There are two standard representations of time.  One is the number\n",
      "    of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer\n",
      "    or a floating point number (to represent fractions of seconds).\n",
      "    The Epoch is system-defined; on Unix, it is generally January 1st, 1970.\n",
      "    The actual value can be retrieved by calling gmtime(0).\n",
      "    \n",
      "    The other representation is a tuple of 9 integers giving local time.\n",
      "    The tuple items are:\n",
      "      year (including century, e.g. 1998)\n",
      "      month (1-12)\n",
      "      day (1-31)\n",
      "      hours (0-23)\n",
      "      minutes (0-59)\n",
      "      seconds (0-59)\n",
      "      weekday (0-6, Monday is 0)\n",
      "      Julian day (day in the year, 1-366)\n",
      "      DST (Daylight Savings Time) flag (-1, 0 or 1)\n",
      "    If the DST flag is 0, the time is given in the regular time zone;\n",
      "    if it is 1, the time is given in the DST time zone;\n",
      "    if it is -1, mktime() should guess based on the date and time.\n",
      "\n",
      "CLASSES\n",
      "    builtins.tuple(builtins.object)\n",
      "        struct_time\n",
      "    \n",
      "    class struct_time(builtins.tuple)\n",
      "     |  struct_time(iterable=(), /)\n",
      "     |  \n",
      "     |  The time value as returned by gmtime(), localtime(), and strptime(), and\n",
      "     |  accepted by asctime(), mktime() and strftime().  May be considered as a\n",
      "     |  sequence of 9 integers.\n",
      "     |  \n",
      "     |  Note that several fields' values are not the same as those defined by\n",
      "     |  the C language standard for struct tm.  For example, the value of the\n",
      "     |  field tm_year is the actual year, not year - 1900.  See individual\n",
      "     |  fields' descriptions for details.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      struct_time\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  tm_gmtoff\n",
      "     |      offset from UTC in seconds\n",
      "     |  \n",
      "     |  tm_hour\n",
      "     |      hours, range [0, 23]\n",
      "     |  \n",
      "     |  tm_isdst\n",
      "     |      1 if summer time is in effect, 0 if not, and -1 if unknown\n",
      "     |  \n",
      "     |  tm_mday\n",
      "     |      day of month, range [1, 31]\n",
      "     |  \n",
      "     |  tm_min\n",
      "     |      minutes, range [0, 59]\n",
      "     |  \n",
      "     |  tm_mon\n",
      "     |      month of year, range [1, 12]\n",
      "     |  \n",
      "     |  tm_sec\n",
      "     |      seconds, range [0, 61])\n",
      "     |  \n",
      "     |  tm_wday\n",
      "     |      day of week, range [0, 6], Monday is 0\n",
      "     |  \n",
      "     |  tm_yday\n",
      "     |      day of year, range [1, 366]\n",
      "     |  \n",
      "     |  tm_year\n",
      "     |      year, for example, 1993\n",
      "     |  \n",
      "     |  tm_zone\n",
      "     |      abbreviation of timezone name\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 11\n",
      "     |  \n",
      "     |  n_sequence_fields = 9\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "\n",
      "FUNCTIONS\n",
      "    asctime(...)\n",
      "        asctime([tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.\n",
      "        When the time tuple is not present, current time as returned by localtime()\n",
      "        is used.\n",
      "    \n",
      "    ctime(...)\n",
      "        ctime(seconds) -> string\n",
      "        \n",
      "        Convert a time in seconds since the Epoch to a string in local time.\n",
      "        This is equivalent to asctime(localtime(seconds)). When the time tuple is\n",
      "        not present, current time as returned by localtime() is used.\n",
      "    \n",
      "    get_clock_info(...)\n",
      "        get_clock_info(name: str) -> dict\n",
      "        \n",
      "        Get information of the specified clock.\n",
      "    \n",
      "    gmtime(...)\n",
      "        gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n",
      "                               tm_sec, tm_wday, tm_yday, tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.\n",
      "        GMT).  When 'seconds' is not passed in, convert the current time instead.\n",
      "        \n",
      "        If the platform supports the tm_gmtoff and tm_zone, they are available as\n",
      "        attributes only.\n",
      "    \n",
      "    localtime(...)\n",
      "        localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n",
      "                                  tm_sec,tm_wday,tm_yday,tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing local time.\n",
      "        When 'seconds' is not passed in, convert the current time instead.\n",
      "    \n",
      "    mktime(...)\n",
      "        mktime(tuple) -> floating point number\n",
      "        \n",
      "        Convert a time tuple in local time to seconds since the Epoch.\n",
      "        Note that mktime(gmtime(0)) will not generally return zero for most\n",
      "        time zones; instead the returned value will either be equal to that\n",
      "        of the timezone or altzone attributes on the time module.\n",
      "    \n",
      "    monotonic(...)\n",
      "        monotonic() -> float\n",
      "        \n",
      "        Monotonic clock, cannot go backward.\n",
      "    \n",
      "    monotonic_ns(...)\n",
      "        monotonic_ns() -> int\n",
      "        \n",
      "        Monotonic clock, cannot go backward, as nanoseconds.\n",
      "    \n",
      "    perf_counter(...)\n",
      "        perf_counter() -> float\n",
      "        \n",
      "        Performance counter for benchmarking.\n",
      "    \n",
      "    perf_counter_ns(...)\n",
      "        perf_counter_ns() -> int\n",
      "        \n",
      "        Performance counter for benchmarking as nanoseconds.\n",
      "    \n",
      "    process_time(...)\n",
      "        process_time() -> float\n",
      "        \n",
      "        Process time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    process_time_ns(...)\n",
      "        process_time() -> int\n",
      "        \n",
      "        Process time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    sleep(...)\n",
      "        sleep(seconds)\n",
      "        \n",
      "        Delay execution for a given number of seconds.  The argument may be\n",
      "        a floating point number for subsecond precision.\n",
      "    \n",
      "    strftime(...)\n",
      "        strftime(format[, tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string according to a format specification.\n",
      "        See the library reference manual for formatting codes. When the time tuple\n",
      "        is not present, current time as returned by localtime() is used.\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    strptime(...)\n",
      "        strptime(string, format) -> struct_time\n",
      "        \n",
      "        Parse a string to a time tuple according to a format specification.\n",
      "        See the library reference manual for formatting codes (same as\n",
      "        strftime()).\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    thread_time(...)\n",
      "        thread_time() -> float\n",
      "        \n",
      "        Thread time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    thread_time_ns(...)\n",
      "        thread_time() -> int\n",
      "        \n",
      "        Thread time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    time(...)\n",
      "        time() -> floating point number\n",
      "        \n",
      "        Return the current time in seconds since the Epoch.\n",
      "        Fractions of a second may be present if the system clock provides them.\n",
      "    \n",
      "    time_ns(...)\n",
      "        time_ns() -> int\n",
      "        \n",
      "        Return the current time in nanoseconds since the Epoch.\n",
      "\n",
      "DATA\n",
      "    altzone = -32400\n",
      "    daylight = 0\n",
      "    timezone = -28800\n",
      "    tzname = ('中国标准时间', '中国夏令时')\n",
      "\n",
      "FILE\n",
      "    (built-in)\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(time)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d3b17ee6",
   "metadata": {},
   "source": [
    "映射：一一对应关系 字典里的值会有重复项出现，key是唯一的。   数列是有顺序的，字典(dict)是无序的，随机分布的（注）\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a90ab7e8",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "153303c7",
   "metadata": {},
   "source": [
    "　　购物车程序项目：\n",
    "\n",
    "　　要求：1、运行程序后，让用户输入支付宝余额，然后打印我们的商品列表给用户。\n",
    "\n",
    "　　   　　2、让用户输入商品编号进行商品的购买。\n",
    "\n",
    "　　  　　 3、用户选择商品后，检查用户的余额是否够，若够则直接扣款，不够则提醒用户。\n",
    "\n",
    "　　　　   4、用户可以随时退出购买，推出时打印用户已购买的商品和支付宝余额。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3dcae700",
   "metadata": {},
   "source": [
    "解决星号报错:尝试中断内核以及重启内核"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ee38291a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入您的余额:99\n",
      "------------商品编号------------\n",
      "商品编号：0，商品的名称: 珍珠奶茶小杯，商品的价格：7 元 \n",
      "商品编号：1，商品的名称: 珍珠奶茶大杯，商品的价格：8.5 元 \n",
      "商品编号：2，商品的名称: 珍珠奶茶加大杯，商品的价格：9.5 元 \n",
      "商品编号：3，商品的名称: 珍珠奶茶1L，商品的价格：12 元 \n",
      "商品编号：4，商品的名称: 珍珠奶茶桶装杯，商品的价格：20 元 \n",
      "请输入正确的商品编号：4\n",
      "【珍珠奶茶桶装杯】 已经添加到您的购物车，您的余额还有 【79】 元\n",
      "------------商品编号------------\n",
      "商品编号：0，商品的名称: 珍珠奶茶小杯，商品的价格：7 元 \n",
      "商品编号：1，商品的名称: 珍珠奶茶大杯，商品的价格：8.5 元 \n",
      "商品编号：2，商品的名称: 珍珠奶茶加大杯，商品的价格：9.5 元 \n",
      "商品编号：3，商品的名称: 珍珠奶茶1L，商品的价格：12 元 \n",
      "商品编号：4，商品的名称: 珍珠奶茶桶装杯，商品的价格：20 元 \n",
      "请输入正确的商品编号：7\n",
      "您输入的商品不存在，请输入正确的编号\n",
      "------------商品编号------------\n",
      "商品编号：0，商品的名称: 珍珠奶茶小杯，商品的价格：7 元 \n",
      "商品编号：1，商品的名称: 珍珠奶茶大杯，商品的价格：8.5 元 \n",
      "商品编号：2，商品的名称: 珍珠奶茶加大杯，商品的价格：9.5 元 \n",
      "商品编号：3，商品的名称: 珍珠奶茶1L，商品的价格：12 元 \n",
      "商品编号：4，商品的名称: 珍珠奶茶桶装杯，商品的价格：20 元 \n",
      "请输入正确的商品编号：2\n",
      "【珍珠奶茶加大杯】 已经添加到您的购物车，您的余额还有 【69】 元\n",
      "------------商品编号------------\n",
      "商品编号：0，商品的名称: 珍珠奶茶小杯，商品的价格：7 元 \n",
      "商品编号：1，商品的名称: 珍珠奶茶大杯，商品的价格：8.5 元 \n",
      "商品编号：2，商品的名称: 珍珠奶茶加大杯，商品的价格：9.5 元 \n",
      "商品编号：3，商品的名称: 珍珠奶茶1L，商品的价格：12 元 \n",
      "商品编号：4，商品的名称: 珍珠奶茶桶装杯，商品的价格：20 元 \n",
      "请输入正确的商品编号：1\n",
      "【珍珠奶茶大杯】 已经添加到您的购物车，您的余额还有 【61】 元\n",
      "------------商品编号------------\n",
      "商品编号：0，商品的名称: 珍珠奶茶小杯，商品的价格：7 元 \n",
      "商品编号：1，商品的名称: 珍珠奶茶大杯，商品的价格：8.5 元 \n",
      "商品编号：2，商品的名称: 珍珠奶茶加大杯，商品的价格：9.5 元 \n",
      "商品编号：3，商品的名称: 珍珠奶茶1L，商品的价格：12 元 \n",
      "商品编号：4，商品的名称: 珍珠奶茶桶装杯，商品的价格：20 元 \n",
      "请输入正确的商品编号：0\n",
      "【珍珠奶茶小杯】 已经添加到您的购物车，您的余额还有 【54】 元\n",
      "------------商品编号------------\n",
      "商品编号：0，商品的名称: 珍珠奶茶小杯，商品的价格：7 元 \n",
      "商品编号：1，商品的名称: 珍珠奶茶大杯，商品的价格：8.5 元 \n",
      "商品编号：2，商品的名称: 珍珠奶茶加大杯，商品的价格：9.5 元 \n",
      "商品编号：3，商品的名称: 珍珠奶茶1L，商品的价格：12 元 \n",
      "商品编号：4，商品的名称: 珍珠奶茶桶装杯，商品的价格：20 元 \n"
     ]
    }
   ],
   "source": [
    "# 1、运行程序后，让用户输入支付宝余额，然后打印我们的商品列表给用户\n",
    "# 商品列表\n",
    "\n",
    "goods_list = [\n",
    "    # 商品1 商品名称，商品价格，商品编号...\n",
    "    # 商品模板 ： [商品名称，]\n",
    "    [\"珍珠奶茶小杯\",7],\n",
    "    [\"珍珠奶茶大杯\",8.5],\n",
    "    [\"珍珠奶茶加大杯\",9.5],\n",
    "    [\"珍珠奶茶1L\",12],\n",
    "    [\"珍珠奶茶桶装杯\",20],\n",
    "]\n",
    "\n",
    "# 不是所有的代码都可以一次性考虑全面！ 例如这里应该写一个用户商品列表\n",
    "user_shopping_cart = [] # append 可以新增商品\n",
    "# 用户输入： input\n",
    "Alipay = int(input(\"请输入您的余额:\"))\n",
    "\n",
    "# 打印商品列表 (规范打印，样式时先写的，然后再输入数据)\n",
    "# 先设计模板样式： 商品编号： xx， 商品名称：xx，商品的价格： xx 元\n",
    "while True:   \n",
    "    print(\"------------商品编号------------\")\n",
    "    for i in range(len(goods_list)):\n",
    "        #  print(\"商品编号：%s， 商品名称：%s，商品的价格：%d 元\"%(0,goods_list[0][0],goods_list[0][1])) \n",
    "        print(\"商品编号：%s，商品的名称: %s，商品的价格：%s 元 \"%(i,goods_list[i][0],goods_list[i][1]))\n",
    "\n",
    "    # 列表的index索引是唯一的\n",
    "\n",
    "    # 2、让用户输入商品编号进行商品的购买\n",
    "    choice = input(\"请输入正确的商品编号：\") # 用户输入可能不是数值，也有可能是\n",
    "    if choice.isdigit():\n",
    "        # 用int转换数据类型为数值\n",
    "        choice = int(choice)\n",
    "        # 是正确的编号\n",
    "        if choice < len(goods_list): # 商品的信息：goods_list[choice] , 商品名称： goods_list[choice][0] 商品价格：goods_list[choioce[1]\n",
    "            # 1. 看用户钱够不够： Alipay VS goods_list[choice][1]\n",
    "            if Alipay < goods_list[choice][1]:\n",
    "                print(\"您的余额不够，请更换支付方式\")\n",
    "            # 2. 如果够的话，赶紧扣钱！把商品加到购物车\n",
    "            else:\n",
    "                Alipay = Alipay - goods_list[choice][1]\n",
    "                user_shopping_cart.append(goods_list[choice])\n",
    "                # 提示用户：本次购买成功\n",
    "                print(\"【%s】 已经添加到您的购物车，您的余额还有 【%d】 元\"%(goods_list[choice][0],Alipay))\n",
    "        else:\n",
    "            print(\"您输入的商品不存在，请输入正确的编号\")\n",
    "    elif choice == \"q\" :\n",
    "        print(\"您的购物车：%s\"%(user_shopping_cart),'\\n',\"您的账户余额：%s 元\"%(Alipay))\n",
    "        # 两种情况\n",
    "        # 1. 按照我们的要求输入的文本，例如：输入q表示quit退出的意思\n",
    "        \n",
    "        # 2. 输入的不符合我们的要求的文本\n",
    "        pass\n",
    "    else:\n",
    "        print(\"请输入正确的商品编号！或者输入“q”退出\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ccc93592",
   "metadata": {},
   "outputs": [],
   "source": [
    "banlce = int(input(\"请输入您的支付宝余额: \"))\n",
    "\n",
    "shopping_car = [] # 购物车\n",
    "goods = ([\"1\", \"xpxvill\", \"￥\", 2599],\n",
    "         [\"2\", \"kith\", \"￥\", 1099],\n",
    "         [\"3\", \"ambush\", \"￥\", 1599])\n",
    "info = '''\n",
    "----------items----------\n",
    "1. xpxvill   ￥ 599\n",
    "2. kith  ￥ 1099\n",
    "3. ambush   ￥ 1599\n",
    "-------------------------\n",
    "'''\n",
    "print(info)\n",
    "while True:\n",
    "    shopindex = int(input(\"请选择你要购买的商品并输入商品编号: \"))\n",
    "    if banlce > goods[shopindex - 1][3]:\n",
    "        shopping_car.append(goods[shopindex - 1])\n",
    "        banlce -= int(goods[shopindex - 1][3])\n",
    "        print(\"恭喜你！你成功购买了 {name} !\".format(name=goods[shopindex - 1][1]))\n",
    "        print(\"你当前支付宝的余额: ￥\", banlce)\n",
    "        decision = input(\"你还有其他选择吗？\")\n",
    "        print('退出请按[2]')\n",
    "        choice = input('2')\n",
    "        if choice == '2':\n",
    "            print(shopping_car)\n",
    "            print('感谢使用，欢迎下次再来！')\n",
    "    else:\n",
    "        print(\"你当前支付宝的余额不足!请尝试其他选择.\")\n",
    "        recharge_ans = input(\"你想要进行支付宝余额充值吗？\")\n",
    "        if recharge_ans == \"是的\":\n",
    "            recharge = int(input(\"请输入充值的金额: \"))\n",
    "            print(\"请等待...\")\n",
    "            banlce += recharge\n",
    "            print(\"恭喜你！余额充值成功！\")\n",
    "            print(\"你现在的支付宝余额为: \", banlce, \"当前！\")\n",
    "        decision = input(\"你还有其他选择吗？\"):\n",
    "            if decision == '1':\n",
    "                print\n",
    "        print('继续购买请按[1]')\n",
    "        print('退出请按[2]')\n",
    "        choice = input('2')\n",
    "        if choice == '2':\n",
    "            print(shopping_car)\n",
    "            print('感谢使用，欢迎下次再来！')\n",
    "    if decision == \"q\":\n",
    "        break\n",
    "    else:\n",
    "        continue\n",
    "print(\"你已成功购买的商品: \", shopping_car)\n",
    "print(\"你当前支付宝余额: ￥\", banlce)\n",
    "print(\"欢迎下次再来!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c697b24e",
   "metadata": {},
   "source": [
    "## 字典的重要属性\n",
    "结构： key:value (键值对）\n",
    "字典是无序的,我们通过键(key）去查找值(value), 就好像list用索引(index）查找值(value)一样，只不过字典的“索引”被定义了名字\n",
    "字典对key的定义有一定的要求: key是由\"不可变\"的数据结构才可以定义，list是不能作为key来定义的 4.字典的key是唯一的（危），字典的值value也可以不唯一（危险）。（list的值是唯一的么？）答：不唯一 3.字典的创建"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7df120ad",
   "metadata": {},
   "outputs": [],
   "source": [
    "users = [\n",
    "    [\"zhichao\",23,\"IT\",20000],\n",
    "    [\"xiaoming\",26,\"IT\",30000]\n",
    "    \n",
    "]\n",
    "# 试对比：\n",
    "users_dict = {\n",
    "    \"zhichao\":[23,\"IT\",20000],\n",
    "    \"xiaoming\":[26,\"IT\",30000]\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9f99f2ab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['xiaoming', 26, 'IT', 30000]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查询xiaoming的信息:\n",
    "users[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "a466cdd3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[26, 'IT', 30000]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "users_dict[\"xiaoming\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3337066e",
   "metadata": {},
   "source": [
    "试问:如果users的数据很大，我想查其中的一个信息，但无法知道其索引值\n",
    "list就变得很无理\n",
    "而dict只需要知道数据的关键信息即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1927f41a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "3247ce2c",
   "metadata": {},
   "source": [
    "---------\n",
    "# 字典\n",
    "\n",
    "> 1.创建字典的三种常见的方法\n",
    ">> 1. 直接按照字典的格式创建 ： {key1:valuel ,key2:value2 ,.... }\n",
    ">> 2. dict()函数来创建字典： dict(key1=value1,key2=value2,......)\n",
    ">> 3.字典数据增加的方式：新建空字典 dict_name ={} , dict_name[key1]=valuel ..."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6d16df1e",
   "metadata": {},
   "source": [
    "info_03"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "0e1aa508",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'stu10001': 'xiaoming', 'stu10002': 'lihua', 'stu10003': 'xiaohong'}\n",
      "<class 'dict'>\n"
     ]
    }
   ],
   "source": [
    "info = {\n",
    "    \"stu10001\":\"xiaoming\",\n",
    "    \"stu10002\":\"lihua\",\n",
    "    \"stu10003\":\"xiaohong\",\n",
    "#     \"stu1004\":\"xiaohong\",\n",
    "}\n",
    "print(info)\n",
    "print(type(info))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "79ccd9d0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'stu10001': 'xiaoming', 'stu10002': 'lihua', 'stu10003': 'xiaohong'}\n",
      "<class 'dict'>\n"
     ]
    }
   ],
   "source": [
    "info_02 = dict(\n",
    "    stu10001=\"xiaoming\",\n",
    "    stu10002=\"lihua\",\n",
    "    stu10003=\"xiaohong\",\n",
    ")\n",
    "print(info_02)\n",
    "print(type(info_02))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "fec19521",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'stu10001': 'xiaoming', 'stu10002': 'lihua', 'stu10003': 'xiaohong'}\n",
      "<class 'dict'>\n"
     ]
    }
   ],
   "source": [
    "info_03 = {}# 新建空字典\n",
    "info_03[\"stu10001\"] = \"xiaoming\"\n",
    "info_03[\"stu10002\"] = \"lihua\"\n",
    "info_03[\"stu10003\"] = \"xiaohong\"\n",
    "print(info)\n",
    "print(type(info))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "04890f78",
   "metadata": {},
   "source": [
    "## 字典的增、删、改、查"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea733875",
   "metadata": {},
   "source": [
    "* 1.字典的增加:(和字典的第三种创建方式一致):info_03[\"stu10004\"]=\"zhichao\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "abf6f84b",
   "metadata": {},
   "source": [
    "* 2.字典的查询:info_03[key name]  注意: 正确的查询方式，应该先查询key是否存在字典当中，如下:\n",
    "            > key_name in info_03 ## 查看是否存在,如果存在，返回结果为True，不存在为False\n",
    "            > info_03[key name] "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e501bf67",
   "metadata": {},
   "source": [
    "* 3.字典的修改\n",
    "查询key是否存在\n",
    "修改key的值\n",
    "> 例如: 修改info_03中stu10003的值为Alex， if\"stu100003\" in info_03 : info_03[\"stu10003\"] = \"Alex\" "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "695eee65",
   "metadata": {},
   "source": [
    "* 4.字典的删除 1.pop(key) 2.popitem()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26934b5f",
   "metadata": {},
   "source": [
    "### 字典（dict）的练习"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5e120df3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> tel = {'jack': 4098, 'sape': 4139}\n",
    ">>> tel['guido'] = 4127\n",
    ">>> tel\n",
    "{'jack': 4098, 'sape': 4139, 'guido': 4127}\n",
    ">>> tel['jack']\n",
    "4098\n",
    ">>> del tel['sape']\n",
    ">>> tel['irv'] = 4127\n",
    ">>> tel\n",
    "{'jack': 4098, 'guido': 4127, 'irv': 4127}\n",
    ">>> list(tel)\n",
    "['jack', 'guido', 'irv']\n",
    ">>> sorted(tel)\n",
    "['guido', 'irv', 'jack']\n",
    ">>> 'guido' in tel\n",
    "True\n",
    ">>> 'jack' not in tel\n",
    "False\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b30f8906",
   "metadata": {},
   "outputs": [],
   "source": [
    "广州南方学院 = {'status': '1',\n",
    " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
    "    'location': '113.678,23.6284',\n",
    "    'direction': '北',\n",
    "    'name': '博学路',\n",
    "    'distance': '7.63232'},\n",
    "   {'id': '020F49F0050462229',\n",
    "    'location': '113.679,23.6245',\n",
    "    'direction': '北',\n",
    "    'name': '老虎形街',\n",
    "    'distance': '445.159'},\n",
    "   {'id': '020F49F0050462451',\n",
    "    'location': '113.677,23.6347',\n",
    "    'direction': '南',\n",
    "    'name': '中山路',\n",
    "    'distance': '708.299'}],\n",
    "  'roadinters': [{'second_name': '中山路',\n",
    "    'first_id': '020F49F0050461206',\n",
    "    'second_id': '020F49F0050462451',\n",
    "    'location': '113.676794,23.634661',\n",
    "    'distance': '708.299',\n",
    "    'first_name': '博学路',\n",
    "    'direction': '南'}],\n",
    "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
    "  'addressComponent': {'city': '广州市',\n",
    "   'province': '广东省',\n",
    "   'adcode': '440117',\n",
    "   'district': '从化区',\n",
    "   'towncode': '440117100000',\n",
    "   'streetNumber': {'number': '24号',\n",
    "    'location': '113.677267,23.629149',\n",
    "    'direction': '西北',\n",
    "    'distance': '129.943',\n",
    "    'street': '博学路'},\n",
    "   'country': '中国',\n",
    "   'township': '温泉镇',\n",
    "   'businessAreas': [[]],\n",
    "   'building': {'name': [], 'type': []},\n",
    "   'neighborhood': {'name': [], 'type': []},\n",
    "   'citycode': '020'},\n",
    "  'aois': [],\n",
    "  'pois': [{'id': 'B0FFG4TAF2',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
    "    'poiweight': '0.237309',\n",
    "    'name': '广州南方公寓',\n",
    "    'location': '113.678983,23.627778',\n",
    "    'distance': '102.617',\n",
    "    'tel': '13622768437',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0H6FA18J5',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院南侧)',\n",
    "    'poiweight': '0.223065',\n",
    "    'name': '保利半山花园',\n",
    "    'location': '113.679358,23.627672',\n",
    "    'distance': '139.054',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅区'},\n",
    "   {'id': 'B00140TWHT',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '笃行路2',\n",
    "    'poiweight': '0.157653',\n",
    "    'name': '教工住宅1号',\n",
    "    'location': '113.678490,23.630432',\n",
    "    'distance': '222.658',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0FFHRJDM9',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '中大南方学院南门1号',\n",
    "    'poiweight': '0.256152',\n",
    "    'name': '中南公寓',\n",
    "    'location': '113.680349,23.627573',\n",
    "    'distance': '231.723',\n",
    "    'tel': '13711245345',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0HGD588HJ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼4号',\n",
    "    'location': '113.677460,23.630490',\n",
    "    'distance': '242.901',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFHZH0IK',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路广州南方学院综合楼内',\n",
    "    'poiweight': '0.17934',\n",
    "    'name': '地下铁',\n",
    "    'location': '113.677941,23.629029',\n",
    "    'distance': '74.1376',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
    "   {'id': 'B0HGDU76L2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院2号实验楼',\n",
    "    'location': '113.678211,23.630956',\n",
    "    'distance': '280.003',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP838K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路25',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼3号(外国语学院)',\n",
    "    'location': '113.677247,23.630947',\n",
    "    'distance': '298.093',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU8NLD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院1号实验楼',\n",
    "    'location': '113.678215,23.631370',\n",
    "    'distance': '326.007',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD58UTU',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院2号教学楼',\n",
    "    'location': '113.677060,23.631346',\n",
    "    'distance': '346.352',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B00140MR9A',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号',\n",
    "    'poiweight': '0.450402',\n",
    "    'name': '广州南方学院',\n",
    "    'location': '113.679262,23.632583',\n",
    "    'distance': '471.564',\n",
    "    'tel': '020-87828988;020-61787331',\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU92JD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': [],\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼1号',\n",
    "    'location': '113.677077,23.631783',\n",
    "    'distance': '391.548',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD592BJ',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道886号广州南方学院内',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院综合楼',\n",
    "    'location': '113.680117,23.631544',\n",
    "    'distance': '392.731',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP81F0',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路19号附近',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼1号(文学与传媒学院)',\n",
    "    'location': '113.676866,23.631736',\n",
    "    'distance': '393.93',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFLBEOND',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.190963',\n",
    "    'name': '聚贤楼10号',\n",
    "    'location': '113.681253,23.631036',\n",
    "    'distance': '418.51',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0FFH6K3U9',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
    "    'poiweight': '0.254885',\n",
    "    'name': '广州中大南方招待所',\n",
    "    'location': '113.676330,23.631332',\n",
    "    'distance': '378.102',\n",
    "    'tel': '020-61787222',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGD58NF8',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院达人书院',\n",
    "    'location': '113.679041,23.632392',\n",
    "    'distance': '446.366',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFKUVYWV',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '保利桃花源',\n",
    "    'poiweight': '0.273168',\n",
    "    'name': '广州和风庭阿七度假别墅',\n",
    "    'location': '113.681736,23.630569',\n",
    "    'distance': '424.35',\n",
    "    'tel': '18681565305',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGDU99RM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内',\n",
    "    'poiweight': '0.257947',\n",
    "    'name': '广州南方学院图书馆',\n",
    "    'location': '113.679177,23.632762',\n",
    "    'distance': '489.331',\n",
    "    'tel': '020-61787368;020-61787371',\n",
    "    'type': '科教文化服务;图书馆;图书馆'},\n",
    "   {'id': 'B0HGDU92JC',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院4号实验楼',\n",
    "    'location': '113.679963,23.632652',\n",
    "    'distance': '498.883',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFL7C054',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
    "    'poiweight': '0.317505',\n",
    "    'name': '广州U优森特酒店',\n",
    "    'location': '113.679226,23.632528',\n",
    "    'distance': '464.819',\n",
    "    'tel': '15813395296',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0FFG8CSEK',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.185371',\n",
    "    'name': 'L5员工宿舍',\n",
    "    'location': '113.682583,23.631487',\n",
    "    'distance': '554.129',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0HGD58FR2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼9号',\n",
    "    'location': '113.679747,23.633032',\n",
    "    'distance': '532.163',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HG5Z9JNK',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221553',\n",
    "    'name': '广州南方学院教学楼7号',\n",
    "    'location': '113.678600,23.633330',\n",
    "    'distance': '544.868',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD599JM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院第11教学楼',\n",
    "    'location': '113.680037,23.633173',\n",
    "    'distance': '556.036',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0GUJYPEG2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
    "    'poiweight': '0.216026',\n",
    "    'name': '怒烤烤串(从化店)',\n",
    "    'location': '113.677160,23.632910',\n",
    "    'distance': '510.112',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
    "   {'id': 'B0HGDU6Z41',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼6号',\n",
    "    'location': '113.678424,23.633710',\n",
    "    'distance': '586.331',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD580NZ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路7号附近',\n",
    "    'poiweight': '0.285712',\n",
    "    'name': '广州南方学院惟贤门',\n",
    "    'location': '113.678437,23.633721',\n",
    "    'distance': '587.601',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU7T1K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院教学楼10号',\n",
    "    'location': '113.680125,23.633492',\n",
    "    'distance': '592.504',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0HGDU76L1',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '中山路与博学路交叉口东南150米',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼5号',\n",
    "    'location': '113.678046,23.633982',\n",
    "    'distance': '616.848',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'}]},\n",
    " 'info': 'OK',\n",
    " 'infocode': '10000'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0be0f3a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
       "    'location': '113.678,23.6284',\n",
       "    'direction': '北',\n",
       "    'name': '博学路',\n",
       "    'distance': '7.63232'},\n",
       "   {'id': '020F49F0050462229',\n",
       "    'location': '113.679,23.6245',\n",
       "    'direction': '北',\n",
       "    'name': '老虎形街',\n",
       "    'distance': '445.159'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '南',\n",
       "    'name': '中山路',\n",
       "    'distance': '708.299'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461206',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '708.299',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117100000',\n",
       "   'streetNumber': {'number': '24号',\n",
       "    'location': '113.677267,23.629149',\n",
       "    'direction': '西北',\n",
       "    'distance': '129.943',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [],\n",
       "  'pois': [{'id': 'B0FFG4TAF2',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "    'poiweight': '0.237309',\n",
       "    'name': '广州南方公寓',\n",
       "    'location': '113.678983,23.627778',\n",
       "    'distance': '102.617',\n",
       "    'tel': '13622768437',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0H6FA18J5',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院南侧)',\n",
       "    'poiweight': '0.223065',\n",
       "    'name': '保利半山花园',\n",
       "    'location': '113.679358,23.627672',\n",
       "    'distance': '139.054',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅区'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '222.658',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFHRJDM9',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '中大南方学院南门1号',\n",
       "    'poiweight': '0.256152',\n",
       "    'name': '中南公寓',\n",
       "    'location': '113.680349,23.627573',\n",
       "    'distance': '231.723',\n",
       "    'tel': '13711245345',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0HGD588HJ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '242.901',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFHZH0IK',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路广州南方学院综合楼内',\n",
       "    'poiweight': '0.17934',\n",
       "    'name': '地下铁',\n",
       "    'location': '113.677941,23.629029',\n",
       "    'distance': '74.1376',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
       "   {'id': 'B0HGDU76L2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '280.003',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '298.093',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU8NLD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '326.007',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD58UTU',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院2号教学楼',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '346.352',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00140MR9A',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '广州南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '471.564',\n",
       "    'tel': '020-87828988;020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU92JD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '391.548',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD592BJ',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号广州南方学院内',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '392.731',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '393.93',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '418.51',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '378.102',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGD58NF8',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院达人书院',\n",
       "    'location': '113.679041,23.632392',\n",
       "    'distance': '446.366',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKUVYWV',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '保利桃花源',\n",
       "    'poiweight': '0.273168',\n",
       "    'name': '广州和风庭阿七度假别墅',\n",
       "    'location': '113.681736,23.630569',\n",
       "    'distance': '424.35',\n",
       "    'tel': '18681565305',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGDU99RM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内',\n",
       "    'poiweight': '0.257947',\n",
       "    'name': '广州南方学院图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '489.331',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0HGDU92JC',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '498.883',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFL7C054',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "    'poiweight': '0.317505',\n",
       "    'name': '广州U优森特酒店',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'distance': '464.819',\n",
       "    'tel': '15813395296',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '554.129',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0HGD58FR2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼9号',\n",
       "    'location': '113.679747,23.633032',\n",
       "    'distance': '532.163',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HG5Z9JNK',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221553',\n",
       "    'name': '广州南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '544.868',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD599JM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '556.036',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0GUJYPEG2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "    'poiweight': '0.216026',\n",
       "    'name': '怒烤烤串(从化店)',\n",
       "    'location': '113.677160,23.632910',\n",
       "    'distance': '510.112',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       "   {'id': 'B0HGDU6Z41',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '586.331',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD580NZ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.285712',\n",
       "    'name': '广州南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '587.601',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU7T1K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '592.504',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0HGDU76L1',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南150米',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼5号',\n",
       "    'location': '113.678046,23.633982',\n",
       "    'distance': '616.848',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "5b3f5321",
   "metadata": {},
   "outputs": [],
   "source": [
    "教工住宅1号 = 广州南方学院 ['regeocode']['pois'][2][ 'name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "1d28e236",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'教工住宅1号'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "教工住宅1号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "6db71786",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 取出教工住宅1号的信息\n",
    "教工住宅1号_name = 广州南方学院['regeocode']['pois'][2]['name']\n",
    "教工住宅1号_address = 广州南方学院['regeocode']['pois'][2]['address']\n",
    "教工住宅1号_localtion = 广州南方学院['regeocode']['pois'][2]['location']\n",
    "教工住宅1号_type = 广州南方学院['regeocode']['pois'][2]['type']\n",
    "教工住宅1号_direction = 广州南方学院['regeocode']['pois'][2]['direction']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4293eeb3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "教工住宅1号\n",
      "笃行路2\n",
      "113.678490,23.630432\n",
      "商务住宅;住宅区;住宅小区\n",
      "北\n"
     ]
    }
   ],
   "source": [
    "print(教工住宅1号_name)\n",
    "print(教工住宅1号_address)\n",
    "print(教工住宅1号_localtion)\n",
    "print(教工住宅1号_type)\n",
    "print(教工住宅1号_direction)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ffabb62f",
   "metadata": {},
   "source": [
    "### 请完成如下字典操作和列表操作的目标\n",
    "* 取出一个'rodas'\n",
    "* 取出一个'roads' 的'name' 道路名字\n",
    "* 取出一个'roads' 的'direction' 路的朝向\n",
    "* 取出所有的'name' 并作成列表"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "81c81eab",
   "metadata": {},
   "source": [
    "> 取出对应的 pois name 所对应的 name 并存成一个list 如name_list = [...]\n",
    "\n",
    "> 取出所有的 pois name 以及其对应的 信息 并分别存成对应的list 如name_location_list = [...]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "30b69b14",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 取出一个'roads'\n",
    "路_roads = 广州南方学院['regeocode']['roads'] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "ae4a645e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': '020F49F0050461206',\n",
       "  'location': '113.678,23.6284',\n",
       "  'direction': '北',\n",
       "  'name': '博学路',\n",
       "  'distance': '7.63232'},\n",
       " {'id': '020F49F0050462229',\n",
       "  'location': '113.679,23.6245',\n",
       "  'direction': '北',\n",
       "  'name': '老虎形街',\n",
       "  'distance': '445.159'},\n",
       " {'id': '020F49F0050462451',\n",
       "  'location': '113.677,23.6347',\n",
       "  'direction': '南',\n",
       "  'name': '中山路',\n",
       "  'distance': '708.299'}]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "路_roads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "50edf7d4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 取出一个'roads'的'name'\n",
    "# 取出一个'roads' 的'direction' 路的朝向\n",
    "路_name = 广州南方学院['regeocode']['roads'][0]['name']\n",
    "路_direction = 广州南方学院['regeocode']['roads'][0]['direction']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "6d94beac",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "博学路\n",
      "北\n"
     ]
    }
   ],
   "source": [
    "print(路_name)\n",
    "print(路_direction)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "a4f79803",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 进阶\n",
    "pois_name = 广州南方学院['regeocode']['pois']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "b81d9c3a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': 'B0FFG4TAF2',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "  'poiweight': '0.237309',\n",
       "  'name': '广州南方公寓',\n",
       "  'location': '113.678983,23.627778',\n",
       "  'distance': '102.617',\n",
       "  'tel': '13622768437',\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0H6FA18J5',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院南侧)',\n",
       "  'poiweight': '0.223065',\n",
       "  'name': '保利半山花园',\n",
       "  'location': '113.679358,23.627672',\n",
       "  'distance': '139.054',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;住宅区'},\n",
       " {'id': 'B00140TWHT',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '笃行路2',\n",
       "  'poiweight': '0.157653',\n",
       "  'name': '教工住宅1号',\n",
       "  'location': '113.678490,23.630432',\n",
       "  'distance': '222.658',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0FFHRJDM9',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '中大南方学院南门1号',\n",
       "  'poiweight': '0.256152',\n",
       "  'name': '中南公寓',\n",
       "  'location': '113.680349,23.627573',\n",
       "  'distance': '231.723',\n",
       "  'tel': '13711245345',\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0HGD588HJ',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼4号',\n",
       "  'location': '113.677460,23.630490',\n",
       "  'distance': '242.901',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFHZH0IK',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路广州南方学院综合楼内',\n",
       "  'poiweight': '0.17934',\n",
       "  'name': '地下铁',\n",
       "  'location': '113.677941,23.629029',\n",
       "  'distance': '74.1376',\n",
       "  'tel': [],\n",
       "  'type': '餐饮服务;冷饮店;冷饮店'},\n",
       " {'id': 'B0HGDU76L2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院2号实验楼',\n",
       "  'location': '113.678211,23.630956',\n",
       "  'distance': '280.003',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFKP838K',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路25',\n",
       "  'poiweight': '0.191742',\n",
       "  'name': '教学楼3号(外国语学院)',\n",
       "  'location': '113.677247,23.630947',\n",
       "  'distance': '298.093',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU8NLD',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路附近',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院1号实验楼',\n",
       "  'location': '113.678215,23.631370',\n",
       "  'distance': '326.007',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD58UTU',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院2号教学楼',\n",
       "  'location': '113.677060,23.631346',\n",
       "  'distance': '346.352',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B00140MR9A',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号',\n",
       "  'poiweight': '0.450402',\n",
       "  'name': '广州南方学院',\n",
       "  'location': '113.679262,23.632583',\n",
       "  'distance': '471.564',\n",
       "  'tel': '020-87828988;020-61787331',\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU92JD',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': [],\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼1号',\n",
       "  'location': '113.677077,23.631783',\n",
       "  'distance': '391.548',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD592BJ',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道886号广州南方学院内',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院综合楼',\n",
       "  'location': '113.680117,23.631544',\n",
       "  'distance': '392.731',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFKP81F0',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路19号附近',\n",
       "  'poiweight': '0.191742',\n",
       "  'name': '教学楼1号(文学与传媒学院)',\n",
       "  'location': '113.676866,23.631736',\n",
       "  'distance': '393.93',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0FFLBEOND',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.190963',\n",
       "  'name': '聚贤楼10号',\n",
       "  'location': '113.681253,23.631036',\n",
       "  'distance': '418.51',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;宿舍'},\n",
       " {'id': 'B0FFH6K3U9',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "  'poiweight': '0.254885',\n",
       "  'name': '广州中大南方招待所',\n",
       "  'location': '113.676330,23.631332',\n",
       "  'distance': '378.102',\n",
       "  'tel': '020-61787222',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0HGD58NF8',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院达人书院',\n",
       "  'location': '113.679041,23.632392',\n",
       "  'distance': '446.366',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0FFKUVYWV',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '保利桃花源',\n",
       "  'poiweight': '0.273168',\n",
       "  'name': '广州和风庭阿七度假别墅',\n",
       "  'location': '113.681736,23.630569',\n",
       "  'distance': '424.35',\n",
       "  'tel': '18681565305',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0HGDU99RM',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院内',\n",
       "  'poiweight': '0.257947',\n",
       "  'name': '广州南方学院图书馆',\n",
       "  'location': '113.679177,23.632762',\n",
       "  'distance': '489.331',\n",
       "  'tel': '020-61787368;020-61787371',\n",
       "  'type': '科教文化服务;图书馆;图书馆'},\n",
       " {'id': 'B0HGDU92JC',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路附近',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院4号实验楼',\n",
       "  'location': '113.679963,23.632652',\n",
       "  'distance': '498.883',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFL7C054',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "  'poiweight': '0.317505',\n",
       "  'name': '广州U优森特酒店',\n",
       "  'location': '113.679226,23.632528',\n",
       "  'distance': '464.819',\n",
       "  'tel': '15813395296',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0FFG8CSEK',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.185371',\n",
       "  'name': 'L5员工宿舍',\n",
       "  'location': '113.682583,23.631487',\n",
       "  'distance': '554.129',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;宿舍'},\n",
       " {'id': 'B0HGD58FR2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '广州南方学院',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼9号',\n",
       "  'location': '113.679747,23.633032',\n",
       "  'distance': '532.163',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HG5Z9JNK',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221553',\n",
       "  'name': '广州南方学院教学楼7号',\n",
       "  'location': '113.678600,23.633330',\n",
       "  'distance': '544.868',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD599JM',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院第11教学楼',\n",
       "  'location': '113.680037,23.633173',\n",
       "  'distance': '556.036',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0GUJYPEG2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "  'poiweight': '0.216026',\n",
       "  'name': '怒烤烤串(从化店)',\n",
       "  'location': '113.677160,23.632910',\n",
       "  'distance': '510.112',\n",
       "  'tel': [],\n",
       "  'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       " {'id': 'B0HGDU6Z41',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼6号',\n",
       "  'location': '113.678424,23.633710',\n",
       "  'distance': '586.331',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD580NZ',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路7号附近',\n",
       "  'poiweight': '0.285712',\n",
       "  'name': '广州南方学院惟贤门',\n",
       "  'location': '113.678437,23.633721',\n",
       "  'distance': '587.601',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU7T1K',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院教学楼10号',\n",
       "  'location': '113.680125,23.633492',\n",
       "  'distance': '592.504',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0HGDU76L1',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '中山路与博学路交叉口东南150米',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼5号',\n",
       "  'location': '113.678046,23.633982',\n",
       "  'distance': '616.848',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'}]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pois_name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "c8c49e80",
   "metadata": {},
   "outputs": [],
   "source": [
    "names_list = 广州南方学院['regeocode']['pois'][0]['name'],广州南方学院['regeocode']['pois'][1]['name'],广州南方学院['regeocode']['pois'][2]['name'],广州南方学院['regeocode']['pois'][3]['name'],广州南方学院['regeocode']['pois'][4]['name'],广州南方学院['regeocode']['pois'][5]['name'],广州南方学院['regeocode']['pois'][6]['name'],广州南方学院['regeocode']['pois'][7]['name'],广州南方学院['regeocode']['pois'][8]['name'],广州南方学院['regeocode']['pois'][9]['name'],广州南方学院['regeocode']['pois'][10]['name'],广州南方学院['regeocode']['pois'][11]['name'],广州南方学院['regeocode']['pois'][12]['name'],广州南方学院['regeocode']['pois'][13]['name'],广州南方学院['regeocode']['pois'][14]['name'],广州南方学院['regeocode']['pois'][15]['name'],广州南方学院['regeocode']['pois'][16]['name'],广州南方学院['regeocode']['pois'][17]['name'],广州南方学院['regeocode']['pois'][18]['name'],广州南方学院['regeocode']['pois'][19]['name'],广州南方学院['regeocode']['pois'][20]['name'],广州南方学院['regeocode']['pois'][21]['name'],广州南方学院['regeocode']['pois'][22]['name'],广州南方学院['regeocode']['pois'][23]['name'],广州南方学院['regeocode']['pois'][24]['name'],广州南方学院['regeocode']['pois'][25]['name'],广州南方学院['regeocode']['pois'][26]['name'],广州南方学院['regeocode']['pois'][27]['name'],广州南方学院['regeocode']['pois'][28]['name'],广州南方学院['regeocode']['pois'][29]['name'],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "1ec67bf0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('广州南方公寓',\n",
       " '保利半山花园',\n",
       " '教工住宅1号',\n",
       " '中南公寓',\n",
       " '广州南方学院教学楼4号',\n",
       " '地下铁',\n",
       " '广州南方学院2号实验楼',\n",
       " '教学楼3号(外国语学院)',\n",
       " '广州南方学院1号实验楼',\n",
       " '广州南方学院2号教学楼',\n",
       " '广州南方学院',\n",
       " '广州南方学院教学楼1号',\n",
       " '广州南方学院综合楼',\n",
       " '教学楼1号(文学与传媒学院)',\n",
       " '聚贤楼10号',\n",
       " '广州中大南方招待所',\n",
       " '广州南方学院达人书院',\n",
       " '广州和风庭阿七度假别墅',\n",
       " '广州南方学院图书馆',\n",
       " '广州南方学院4号实验楼',\n",
       " '广州U优森特酒店',\n",
       " 'L5员工宿舍',\n",
       " '广州南方学院教学楼9号',\n",
       " '广州南方学院教学楼7号',\n",
       " '广州南方学院第11教学楼',\n",
       " '怒烤烤串(从化店)',\n",
       " '广州南方学院教学楼6号',\n",
       " '广州南方学院惟贤门',\n",
       " '广州南方学院教学楼10号',\n",
       " '广州南方学院教学楼5号')"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "names_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "aee85939",
   "metadata": {},
   "outputs": [],
   "source": [
    "# pois name对应的信息列表\n",
    "name_direction_list = 广州南方学院['regeocode']['pois'][0]['direction'],广州南方学院['regeocode']['pois'][1]['direction'],广州南方学院['regeocode']['pois'][2]['direction'],广州南方学院['regeocode']['pois'][3]['direction'],广州南方学院['regeocode']['pois'][4]['direction'],广州南方学院['regeocode']['pois'][5]['direction'],广州南方学院['regeocode']['pois'][6]['direction'],广州南方学院['regeocode']['pois'][7]['direction'],广州南方学院['regeocode']['pois'][8]['direction'],广州南方学院['regeocode']['pois'][9]['direction'],广州南方学院['regeocode']['pois'][10]['direction'],广州南方学院['regeocode']['pois'][11]['direction'],广州南方学院['regeocode']['pois'][12]['direction'],广州南方学院['regeocode']['pois'][13]['direction'],广州南方学院['regeocode']['pois'][14]['direction'],广州南方学院['regeocode']['pois'][15]['direction'],广州南方学院['regeocode']['pois'][16]['direction'],广州南方学院['regeocode']['pois'][17]['direction'],广州南方学院['regeocode']['pois'][18]['direction'],广州南方学院['regeocode']['pois'][19]['direction'],广州南方学院['regeocode']['pois'][20]['direction'],广州南方学院['regeocode']['pois'][21]['direction'],广州南方学院['regeocode']['pois'][22]['direction'],广州南方学院['regeocode']['pois'][23]['direction'],广州南方学院['regeocode']['pois'][24]['direction'],广州南方学院['regeocode']['pois'][25]['direction'],广州南方学院['regeocode']['pois'][26]['direction'],广州南方学院['regeocode']['pois'][27]['direction'],广州南方学院['regeocode']['pois'][28]['direction'],广州南方学院['regeocode']['pois'][29]['direction'],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "9fd71fab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('东南',\n",
       " '东南',\n",
       " '北',\n",
       " '东南',\n",
       " '北',\n",
       " '西北',\n",
       " '北',\n",
       " '北',\n",
       " '北',\n",
       " '西北',\n",
       " '北',\n",
       " '北',\n",
       " '东北',\n",
       " '西北',\n",
       " '东北',\n",
       " '西北',\n",
       " '北',\n",
       " '东北',\n",
       " '北',\n",
       " '北',\n",
       " '北',\n",
       " '东北',\n",
       " '北',\n",
       " '北',\n",
       " '北',\n",
       " '北',\n",
       " '北',\n",
       " '北',\n",
       " '北',\n",
       " '北')"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_direction_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "c0d5205c",
   "metadata": {},
   "outputs": [],
   "source": [
    "name_address_list = 广州南方学院['regeocode']['pois'][0]['address'],广州南方学院['regeocode']['pois'][1]['address'],广州南方学院['regeocode']['pois'][2]['address'],广州南方学院['regeocode']['pois'][3]['address'],广州南方学院['regeocode']['pois'][4]['address'],广州南方学院['regeocode']['pois'][5]['address'],广州南方学院['regeocode']['pois'][6]['address'],广州南方学院['regeocode']['pois'][7]['address'],广州南方学院['regeocode']['pois'][8]['address'],广州南方学院['regeocode']['pois'][9]['address'],广州南方学院['regeocode']['pois'][10]['address'],广州南方学院['regeocode']['pois'][11]['address'],广州南方学院['regeocode']['pois'][12]['address'],广州南方学院['regeocode']['pois'][13]['address'],广州南方学院['regeocode']['pois'][14]['address'],广州南方学院['regeocode']['pois'][15]['address'],广州南方学院['regeocode']['pois'][16]['address'],广州南方学院['regeocode']['pois'][17]['address'],广州南方学院['regeocode']['pois'][18]['address'],广州南方学院['regeocode']['pois'][19]['address'],广州南方学院['regeocode']['pois'][20]['address'],广州南方学院['regeocode']['pois'][21]['address'],广州南方学院['regeocode']['pois'][22]['address'],广州南方学院['regeocode']['pois'][23]['address'],广州南方学院['regeocode']['pois'][24]['address'],广州南方学院['regeocode']['pois'][25]['address'],广州南方学院['regeocode']['pois'][26]['address'],广州南方学院['regeocode']['pois'][27]['address'],广州南方学院['regeocode']['pois'][28]['address'],广州南方学院['regeocode']['pois'][29]['address'],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "f6de82c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('温泉镇乌土村松浪队5号(近博学路)',\n",
       " '从莞深高速(广州南方学院南侧)',\n",
       " '笃行路2',\n",
       " '中大南方学院南门1号',\n",
       " '博学路',\n",
       " '博学路广州南方学院综合楼内',\n",
       " '博学路',\n",
       " '博学路25',\n",
       " '博学路附近',\n",
       " '博学路',\n",
       " '温泉大道882号',\n",
       " [],\n",
       " '温泉大道886号广州南方学院内',\n",
       " '博学路19号附近',\n",
       " '从莞深高速(广州南方学院)',\n",
       " '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       " '温泉大道882号广州南方学院新综合楼2层',\n",
       " '保利桃花源',\n",
       " '温泉大道882号广州南方学院内',\n",
       " '博学路附近',\n",
       " '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       " '从莞深高速(广州南方学院)',\n",
       " '广州南方学院',\n",
       " '博学路',\n",
       " '温泉大道882号广州南方学院',\n",
       " '温泉大道882号广州南方学院内博学路6号之3',\n",
       " '温泉大道882',\n",
       " '博学路7号附近',\n",
       " '从莞深高速(广州南方学院)',\n",
       " '中山路与博学路交叉口东南150米')"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_address_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "af455ec1",
   "metadata": {},
   "outputs": [],
   "source": [
    "name_poiweight_list = 广州南方学院['regeocode']['pois'][0]['poiweight'],广州南方学院['regeocode']['pois'][1]['poiweight'],广州南方学院['regeocode']['pois'][2]['poiweight'],广州南方学院['regeocode']['pois'][3]['poiweight'],广州南方学院['regeocode']['pois'][4]['poiweight'],广州南方学院['regeocode']['pois'][5]['poiweight'],广州南方学院['regeocode']['pois'][6]['poiweight'],广州南方学院['regeocode']['pois'][7]['poiweight'],广州南方学院['regeocode']['pois'][8]['poiweight'],广州南方学院['regeocode']['pois'][9]['poiweight'],广州南方学院['regeocode']['pois'][10]['poiweight'],广州南方学院['regeocode']['pois'][11]['poiweight'],广州南方学院['regeocode']['pois'][12]['poiweight'],广州南方学院['regeocode']['pois'][13]['poiweight'],广州南方学院['regeocode']['pois'][14]['poiweight'],广州南方学院['regeocode']['pois'][15]['poiweight'],广州南方学院['regeocode']['pois'][16]['poiweight'],广州南方学院['regeocode']['pois'][17]['poiweight'],广州南方学院['regeocode']['pois'][18]['poiweight'],广州南方学院['regeocode']['pois'][19]['poiweight'],广州南方学院['regeocode']['pois'][20]['poiweight'],广州南方学院['regeocode']['pois'][21]['poiweight'],广州南方学院['regeocode']['pois'][22]['poiweight'],广州南方学院['regeocode']['pois'][23]['poiweight'],广州南方学院['regeocode']['pois'][24]['poiweight'],广州南方学院['regeocode']['pois'][25]['poiweight'],广州南方学院['regeocode']['pois'][26]['poiweight'],广州南方学院['regeocode']['pois'][27]['poiweight'],广州南方学院['regeocode']['pois'][28]['poiweight'],广州南方学院['regeocode']['pois'][29]['poiweight'],\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "7abdfa71",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('0.237309',\n",
       " '0.223065',\n",
       " '0.157653',\n",
       " '0.256152',\n",
       " '0.221662',\n",
       " '0.17934',\n",
       " '0.221662',\n",
       " '0.191742',\n",
       " '0.221662',\n",
       " '0.191229',\n",
       " '0.450402',\n",
       " '0.221662',\n",
       " '0.221662',\n",
       " '0.191742',\n",
       " '0.190963',\n",
       " '0.254885',\n",
       " '0.191229',\n",
       " '0.273168',\n",
       " '0.257947',\n",
       " '0.221662',\n",
       " '0.317505',\n",
       " '0.185371',\n",
       " '0.221662',\n",
       " '0.221553',\n",
       " '0.221662',\n",
       " '0.216026',\n",
       " '0.221662',\n",
       " '0.285712',\n",
       " '0.191229',\n",
       " '0.221662')"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_poiweight_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "2fad483c",
   "metadata": {},
   "outputs": [],
   "source": [
    "name_location_list = 广州南方学院['regeocode']['pois'][0]['location'],广州南方学院['regeocode']['pois'][1]['location'],广州南方学院['regeocode']['pois'][2]['location'],广州南方学院['regeocode']['pois'][3]['location'],广州南方学院['regeocode']['pois'][4]['location'],广州南方学院['regeocode']['pois'][5]['location'],广州南方学院['regeocode']['pois'][6]['location'],广州南方学院['regeocode']['pois'][7]['location'],广州南方学院['regeocode']['pois'][8]['location'],广州南方学院['regeocode']['pois'][9]['location'],广州南方学院['regeocode']['pois'][10]['location'],广州南方学院['regeocode']['pois'][11]['location'],广州南方学院['regeocode']['pois'][12]['location'],广州南方学院['regeocode']['pois'][13]['location'],广州南方学院['regeocode']['pois'][14]['location'],广州南方学院['regeocode']['pois'][15]['location'],广州南方学院['regeocode']['pois'][16]['location'],广州南方学院['regeocode']['pois'][17]['location'],广州南方学院['regeocode']['pois'][18]['location'],广州南方学院['regeocode']['pois'][19]['location'],广州南方学院['regeocode']['pois'][20]['location'],广州南方学院['regeocode']['pois'][21]['location'],广州南方学院['regeocode']['pois'][22]['location'],广州南方学院['regeocode']['pois'][23]['location'],广州南方学院['regeocode']['pois'][24]['location'],广州南方学院['regeocode']['pois'][25]['location'],广州南方学院['regeocode']['pois'][26]['location'],广州南方学院['regeocode']['pois'][27]['location'],广州南方学院['regeocode']['pois'][28]['location'],广州南方学院['regeocode']['pois'][29]['location'],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "7b758061",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('113.678983,23.627778',\n",
       " '113.679358,23.627672',\n",
       " '113.678490,23.630432',\n",
       " '113.680349,23.627573',\n",
       " '113.677460,23.630490',\n",
       " '113.677941,23.629029',\n",
       " '113.678211,23.630956',\n",
       " '113.677247,23.630947',\n",
       " '113.678215,23.631370',\n",
       " '113.677060,23.631346',\n",
       " '113.679262,23.632583',\n",
       " '113.677077,23.631783',\n",
       " '113.680117,23.631544',\n",
       " '113.676866,23.631736',\n",
       " '113.681253,23.631036',\n",
       " '113.676330,23.631332',\n",
       " '113.679041,23.632392',\n",
       " '113.681736,23.630569',\n",
       " '113.679177,23.632762',\n",
       " '113.679963,23.632652',\n",
       " '113.679226,23.632528',\n",
       " '113.682583,23.631487',\n",
       " '113.679747,23.633032',\n",
       " '113.678600,23.633330',\n",
       " '113.680037,23.633173',\n",
       " '113.677160,23.632910',\n",
       " '113.678424,23.633710',\n",
       " '113.678437,23.633721',\n",
       " '113.680125,23.633492',\n",
       " '113.678046,23.633982')"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_location_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "6cfc1dea",
   "metadata": {},
   "outputs": [],
   "source": [
    "name_distance_list = 广州南方学院['regeocode']['pois'][0]['distance'],广州南方学院['regeocode']['pois'][1]['distance'],广州南方学院['regeocode']['pois'][2]['distance'],广州南方学院['regeocode']['pois'][3]['distance'],广州南方学院['regeocode']['pois'][4]['distance'],广州南方学院['regeocode']['pois'][5]['distance'],广州南方学院['regeocode']['pois'][6]['distance'],广州南方学院['regeocode']['pois'][7]['distance'],广州南方学院['regeocode']['pois'][8]['distance'],广州南方学院['regeocode']['pois'][9]['distance'],广州南方学院['regeocode']['pois'][10]['distance'],广州南方学院['regeocode']['pois'][11]['distance'],广州南方学院['regeocode']['pois'][12]['distance'],广州南方学院['regeocode']['pois'][13]['distance'],广州南方学院['regeocode']['pois'][14]['distance'],广州南方学院['regeocode']['pois'][15]['distance'],广州南方学院['regeocode']['pois'][16]['distance'],广州南方学院['regeocode']['pois'][17]['distance'],广州南方学院['regeocode']['pois'][18]['distance'],广州南方学院['regeocode']['pois'][19]['distance'],广州南方学院['regeocode']['pois'][20]['distance'],广州南方学院['regeocode']['pois'][21]['distance'],广州南方学院['regeocode']['pois'][22]['distance'],广州南方学院['regeocode']['pois'][23]['distance'],广州南方学院['regeocode']['pois'][24]['distance'],广州南方学院['regeocode']['pois'][25]['distance'],广州南方学院['regeocode']['pois'][26]['distance'],广州南方学院['regeocode']['pois'][27]['distance'],广州南方学院['regeocode']['pois'][28]['distance'],广州南方学院['regeocode']['pois'][29]['distance'],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "915254b7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('102.617',\n",
       " '139.054',\n",
       " '222.658',\n",
       " '231.723',\n",
       " '242.901',\n",
       " '74.1376',\n",
       " '280.003',\n",
       " '298.093',\n",
       " '326.007',\n",
       " '346.352',\n",
       " '471.564',\n",
       " '391.548',\n",
       " '392.731',\n",
       " '393.93',\n",
       " '418.51',\n",
       " '378.102',\n",
       " '446.366',\n",
       " '424.35',\n",
       " '489.331',\n",
       " '498.883',\n",
       " '464.819',\n",
       " '554.129',\n",
       " '532.163',\n",
       " '544.868',\n",
       " '556.036',\n",
       " '510.112',\n",
       " '586.331',\n",
       " '587.601',\n",
       " '592.504',\n",
       " '616.848')"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_distance_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "b518d6d1",
   "metadata": {},
   "outputs": [],
   "source": [
    "name_tel_list = 广州南方学院['regeocode']['pois'][0]['tel'],广州南方学院['regeocode']['pois'][1]['tel'],广州南方学院['regeocode']['pois'][2]['tel'],广州南方学院['regeocode']['pois'][3]['tel'],广州南方学院['regeocode']['pois'][4]['tel'],广州南方学院['regeocode']['pois'][5]['tel'],广州南方学院['regeocode']['pois'][6]['tel'],广州南方学院['regeocode']['pois'][7]['tel'],广州南方学院['regeocode']['pois'][8]['tel'],广州南方学院['regeocode']['pois'][9]['tel'],广州南方学院['regeocode']['pois'][10]['tel'],广州南方学院['regeocode']['pois'][11]['tel'],广州南方学院['regeocode']['pois'][12]['tel'],广州南方学院['regeocode']['pois'][13]['tel'],广州南方学院['regeocode']['pois'][14]['tel'],广州南方学院['regeocode']['pois'][15]['tel'],广州南方学院['regeocode']['pois'][16]['tel'],广州南方学院['regeocode']['pois'][17]['tel'],广州南方学院['regeocode']['pois'][18]['tel'],广州南方学院['regeocode']['pois'][19]['tel'],广州南方学院['regeocode']['pois'][20]['tel'],广州南方学院['regeocode']['pois'][21]['tel'],广州南方学院['regeocode']['pois'][22]['tel'],广州南方学院['regeocode']['pois'][23]['tel'],广州南方学院['regeocode']['pois'][24]['tel'],广州南方学院['regeocode']['pois'][25]['tel'],广州南方学院['regeocode']['pois'][26]['tel'],广州南方学院['regeocode']['pois'][27]['tel'],广州南方学院['regeocode']['pois'][28]['tel'],广州南方学院['regeocode']['pois'][29]['tel'],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "89d89bf9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('13622768437',\n",
       " [],\n",
       " [],\n",
       " '13711245345',\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " '020-87828988;020-61787331',\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " '020-61787222',\n",
       " [],\n",
       " '18681565305',\n",
       " '020-61787368;020-61787371',\n",
       " [],\n",
       " '15813395296',\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [],\n",
       " [])"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_tel_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "2bb1a890",
   "metadata": {},
   "outputs": [],
   "source": [
    "name_type_list = 广州南方学院['regeocode']['pois'][0]['type'],广州南方学院['regeocode']['pois'][1]['type'],广州南方学院['regeocode']['pois'][2]['type'],广州南方学院['regeocode']['pois'][3]['type'],广州南方学院['regeocode']['pois'][4]['type'],广州南方学院['regeocode']['pois'][5]['type'],广州南方学院['regeocode']['pois'][6]['type'],广州南方学院['regeocode']['pois'][7]['type'],广州南方学院['regeocode']['pois'][8]['type'],广州南方学院['regeocode']['pois'][9]['type'],广州南方学院['regeocode']['pois'][10]['type'],广州南方学院['regeocode']['pois'][11]['type'],广州南方学院['regeocode']['pois'][12]['type'],广州南方学院['regeocode']['pois'][13]['type'],广州南方学院['regeocode']['pois'][14]['type'],广州南方学院['regeocode']['pois'][15]['type'],广州南方学院['regeocode']['pois'][16]['type'],广州南方学院['regeocode']['pois'][17]['type'],广州南方学院['regeocode']['pois'][18]['type'],广州南方学院['regeocode']['pois'][19]['type'],广州南方学院['regeocode']['pois'][20]['type'],广州南方学院['regeocode']['pois'][21]['type'],广州南方学院['regeocode']['pois'][22]['type'],广州南方学院['regeocode']['pois'][23]['type'],广州南方学院['regeocode']['pois'][24]['type'],广州南方学院['regeocode']['pois'][25]['type'],广州南方学院['regeocode']['pois'][26]['type'],广州南方学院['regeocode']['pois'][27]['type'],广州南方学院['regeocode']['pois'][28]['type'],广州南方学院['regeocode']['pois'][29]['type'],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "25c13a06",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('商务住宅;住宅区;住宅小区',\n",
       " '商务住宅;住宅区;住宅区',\n",
       " '商务住宅;住宅区;住宅小区',\n",
       " '商务住宅;住宅区;住宅小区',\n",
       " '科教文化服务;学校;学校',\n",
       " '餐饮服务;冷饮店;冷饮店',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;学校;高等院校',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;学校;高等院校',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;科教文化场所;科教文化场所',\n",
       " '商务住宅;住宅区;宿舍',\n",
       " '住宿服务;住宿服务相关;住宿服务相关',\n",
       " '科教文化服务;科教文化场所;科教文化场所',\n",
       " '住宿服务;住宿服务相关;住宿服务相关',\n",
       " '科教文化服务;图书馆;图书馆',\n",
       " '科教文化服务;学校;学校',\n",
       " '住宿服务;住宿服务相关;住宿服务相关',\n",
       " '商务住宅;住宅区;宿舍',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;学校;学校',\n",
       " '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       " '科教文化服务;学校;学校',\n",
       " '科教文化服务;学校;高等院校',\n",
       " '科教文化服务;科教文化场所;科教文化场所',\n",
       " '科教文化服务;学校;学校')"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_type_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "f0062c32",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# 总name列表\n",
    "list = 广州南方学院['regeocode']['pois'][0][ 'name'], 广州南方学院['regeocode']['pois'][1][ 'name'], 广州南方学院['regeocode']['pois'][2][ 'name'], 广州南方学院['regeocode']['pois'][3][ 'name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "53910532",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('广州南方公寓', '保利半山花园', '教工住宅1号', '中南公寓')"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cb3e0133",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
